import java.util.*;

public class Main {

    public static int solution(String word) {
        // PLEASE DO NOT MODIFY THE FUNCTION SIGNATURE
        // write code here

        // Convert string to char array and replace alphabetic characters with spaces
        char[] wordArray = word.toCharArray();
        for (int i = 0; i < wordArray.length; i++) {
            if (Character.isLetter(wordArray[i])) {
                wordArray[i] = ' ';
            }
        }

        // Split by spaces to get number strings
        String[] numList = new String(wordArray).split(" ");

        // Use Set to store unique numbers
        Set<Integer> result = new HashSet<>();

        for (String n : numList) {
            if (!n.isEmpty()) {
                result.add(Integer.parseInt(n));
            }
        }

        return result.size();
    }

    public static void main(String[] args) {
        System.out.println(solution("a123bc34d8ef34") == 3);
        System.out.println(solution("t1234c23456") == 2);
        System.out.println(solution("a1b01c001d4") == 2);
    }
}